from apps.views.admin.adminuser import AdminLogin
from django.urls import path
from rest_framework.routers import DefaultRouter
from apps.views.admin.adminuserinfo import AdminInfoDeleteView, AdminInfoUpdateView, \
    AdminInfoListView, AdminInfoCreateView
from apps.views.admin.classification import AdminClassificationListView, AdminClassificationDeleteView, \
    AdminClassificationUpdateView
from apps.views.admin.Adminthing import AdminThingDeleteView, AdminThingUpdateView, \
    AdminThingCreateView, AdminThingListView
from apps.views.admin.comment import AdminCommentView, AdminCommentDeleteView
from apps.views.admin.errorlog import ErrorLogView
from apps.views.admin.loginlog import LoginLogView
from apps.views.admin.notice import AdminNoticeView, AdminNoticeDeleteView
from apps.views.admin.overcount import OverCountView
from apps.views.admin.sysinfo import SysInfoView

from apps.views.admin.tag import AdminTagView, AdminDeleteView, AdminTagUpdateView
from apps.views.main.Classification import ClassificationView
from apps.views.main.Comment import CommentListView, CommentDeleteView, CommentLike
from apps.views.main.Order import OrderPayView, OrderSuccessView, CreateOrderView, OrderListView, OrderCancel
from apps.views.main.Recommend import IncreaseRecommend
from apps.views.main.Tag import TagView
from apps.views.main.address import AddressCreateView, AddAddressListView, AddressDeleteView, AddressUpdateView
from apps.views.main.notice import NoticeListView
from apps.views.main.shopping import ShoppingList
from apps.views.main.thing import PV, IncreaseCollect, removeCollectUser, GetCollectThingListView, ListUserCenterThing
from apps.views.main.thing import HouseKeepingView
from apps.views.main.user import UserRegister, LoginView, CreateView, GetUserDataView, UpdateData, OrderView, ChangePasswordView, ListUserSetting, Logout
from apps.views.main.wish import IncreaseWish, RemoveWishUser, GetWishThingListView

router = DefaultRouter()
# 分类
router.register('classification', ClassificationView, 'classification')
router.register('tag', TagView, 'tag')
# 家政
router.register('housekeeping', HouseKeepingView, 'housekeeping')
router.register('pv', PV, 'pv')
router.register('thing_comment', CommentListView, 'thing_comment')
#个人设置
router.register("update", UpdateData, "update")
#显示个人设置
router.register("listUserinfo", ListUserSetting, "listUserinfo")
router.register("order", OrderView, "order")
# 新增 删除评论
router.register('comment_delete', CommentDeleteView, 'comment_delete')
# 家政注册
router.register("create", CreateView, basename="create")
# 家政注册中 查询单个登录用户信息
router.register("getuser", GetUserDataView, basename='getuser')
# 点赞+1
router.register("comment_like", CommentLike, basename='comment_like')
# 展示收藏列表
router.register("collect_UserList", GetCollectThingListView, basename='collect_UserList')
# 加入收藏
router.register("add_collect", IncreaseCollect, basename='add_collect')

# 移除收藏
router.register('removeCollectUser', removeCollectUser, basename='remove')
# 加入心愿单
router.register("add_wish", IncreaseWish, basename='wish_count')
# 展示心愿单列表
router.register("wish_UserList", GetWishThingListView, basename='wish_list')
# 移除心愿单
router.register("removeWishUser", RemoveWishUser, basename='remove_wish')

# 详情页热门推荐
router.register("thing_hot", IncreaseRecommend, basename='thing_hot')
# 购物车展示
router.register("shopping_list", ShoppingList, basename='shopping_list')
# 立即预约创建订单
router.register("shopping_create", CreateOrderView, basename='shopping_create')
# 查询地址
router.register("address/list", AddAddressListView, basename='address_list')
# 新建地址
router.register("address/create", AddressCreateView, basename='address_create')
# 修改地址
router.register("address/update", AddressUpdateView, basename='address_update')
# 删除地址
router.register("address/delete", AddressDeleteView, basename='address_delete')
# 支付
router.register("order_create", OrderPayView, basename='pay')
# 支付返回
router.register("pay_success", OrderSuccessView, basename='pay_return')
#用户家政入住
router.register("user_housekeeping", ListUserCenterThing, basename='user_housekeeping')
# 预约订单详情显示
router.register("order/list", OrderListView, basename='order_list')
#取消订单
router.register("order/cancel", OrderCancel, basename='order_cancel')
#用户注销
router.register("userLogout", Logout, basename='userLogout')
#通知
router.register("notice/list", NoticeListView, basename='notice_list')
# admin---------------------------------------------------------------------

# 关键字查询
# router.register("admin_search", AdminInfoSearchView, basename='admin_search')
# 家政管理
router.register("admin_housekeeping/list", AdminThingListView, basename='admin_thing_list')
router.register("admin_housekeeping/create", AdminThingCreateView, basename='admin_thing_create')
router.register("admin_housekeeping/update", AdminThingUpdateView, basename='admin_thing_update')
router.register("admin_housekeeping/delete", AdminThingDeleteView, basename='admin_thing_delete')

# 分类
router.register("admin_classification/list", AdminClassificationListView, basename='admin_classification_list')
router.register("admin_classification/create", AdminClassificationListView, basename='admin_classification_create')
router.register("admin_classification/update", AdminClassificationUpdateView, basename='admin_classification_update')
router.register("admin_classification/delete", AdminClassificationDeleteView, basename='admin_classification_delete')
# 标签
router.register("admin_tag/list", AdminTagView, basename='admin_tag_list')
router.register("admin_tag/create", AdminTagView, basename='admin_tag_create')
router.register("admin_tag/update", AdminTagUpdateView, basename='admin_tag_update')
router.register("admin_tag/delete", AdminDeleteView, basename='admin_tag_delete')

# 评论
router.register('admin_comments/list', AdminCommentView, basename='admin_comments_list')
router.register('admin_comments/create', AdminCommentView, basename='admin_comments_create')
router.register('admin_comments/update', AdminCommentView, basename='admin_comments_update')
router.register('admin_comments/delete', AdminCommentDeleteView, basename='admin_comments_delete')

# 用户
router.register("admin_userinfo/list", AdminInfoListView, basename='admin_userinfo_list')
router.register("admin_userinfo/create", AdminInfoCreateView, basename='admin_userinfo_create')
router.register("admin_userinfo/update", AdminInfoUpdateView, basename='admin_userinfo_update')
router.register("admin_userinfo/delete", AdminInfoDeleteView, basename='admin_userinfo_delete')
# 登录日志
router.register("admin_log", LoginLogView, basename='admin_log')
# 错误日志
router.register("admin_ErrorLog", ErrorLogView, basename='admin_ErrorLog')
# 广告通知
router.register("admin_notice/list", AdminNoticeView, basename='admin_notice_list')
router.register("admin_notice/create", AdminNoticeView, basename='admin_notice_create')
router.register("admin_notice/update", AdminNoticeView, basename='admin_notice_update')
router.register("admin_notice/delete", AdminNoticeDeleteView, basename='admin_notice_delete')

# 系统信息
router.register("admin_sysinfo", SysInfoView, basename='admin_sysinfo')
# 统计分析
router.register("admin_OverCount", OverCountView, basename='admin_OverCount')

# 注册
router.register('register', UserRegister, basename="register")
router.register('login', LoginView, basename="login")
urlpatterns = [
    # path('register/', UserRegister.as_view()),
    # path('login/', LoginView.as_view()),

    path('admin/adminLogin', AdminLogin.as_view()),
    # 修改密码
    path('changepwd/', ChangePasswordView.as_view()),
    # path('admin_housekeeping/delete/', AdminThingDeleteView.as_view)
]
urlpatterns += router.urls
